// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 创建用户 POST /api/module/Cust */
export async function custCreate(
  body: API.CustomerCreateInputModel,
  options?: { [key: string]: any },
) {
  return request<API.Result>('/api/module/Cust', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 单个查询 GET /api/module/Cust/${param0} */
export async function custFirst(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.CustFirstParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Result1Customer>(`/api/module/Cust/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 批量删除用户 DELETE /api/module/Cust/${param0} */
export async function custBulkDeletes(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.CustBulkDeletesParams,
  options?: { [key: string]: any },
) {
  const { ids: param0, ...queryParams } = params;
  return request<API.Result>(`/api/module/Cust/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 修改用户头像 PUT /api/module/Cust/Avatar */
export async function custUpdateAvatar(
  body: API.UpdateAvatarInputModel,
  options?: { [key: string]: any },
) {
  return request<API.Result>('/api/module/Cust/Avatar', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改用户邮箱 PUT /api/module/Cust/Email */
export async function custUpdateEmail(
  body: API.CustomerUpdateEmailInputModel,
  options?: { [key: string]: any },
) {
  return request<API.Result>('/api/module/Cust/Email', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取用户信息 GET /api/module/Cust/Info */
export async function custGetCustInfo(options?: { [key: string]: any }) {
  return request<API.Result1CustomerOutputModel>('/api/module/Cust/Info', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 分页查询 GET /api/module/Cust/Page */
export async function custPagination(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.CustPaginationParams,
  options?: { [key: string]: any },
) {
  return request<API.PageResult1CustomerOutputModel>('/api/module/Cust/Page', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
